{% extends "admin.base.html" %}
{% block adminbody %}
{% if msg %}
<h1>{{msg}}</h1>
{% endif %}
<div class="formcontainer">
	<form action="{{request.path}}" method=POST>
		{% if model %}
		<div>
		<ul class="gallery">
				<li class="model">
					{% if model.avatar %}
					<a href="/admin/album/{{ model.username}}">
						<img class="avatar" src="{{host_img}}/{{model.username}}/{{model.avatar|imagename}}" alt="{{model.name}}">
					</a>
					{% endif %}
					<div class="name">&gt;<a class="mokolink" title="mobile top girl:{{model.name}}" href="/admin/album/{{ model.username}}">{{model.name_cn}}/{{model.name_en}}</a></div>
					<div {% ifequal model.get_album_count 0 %} class="warn" {% endifequal %}>album:{{model.get_album_count}}/{{model.get_album_iphone_count}}|<a href="/model/{{model.username}}?action=update">Fetch Now</a></div>
					<div><span class='warn'>[photos:{{model.get_photo_count}}|{{model.get_moko_photo_count}}@moko]</span></div>
					<div class="command">
						<span><a class="mokolink" href="/admin/model/{{model.username}}">Edit Detail</a></span>
					</div>
					<div class="form">
					<input type="hidden" id="model_{{model.username}}" name="model_{{model.username}}" value="1"/>
					{% if not model.mtg %}
						<input type="checkbox" id="mtg_{{model.username}}" name="mtg_{{model.username}}"/>MTG
					{% else %}
						<input type="checkbox" id="mtg_{{model.username}}" name="mtg_{{model.username}}" {% if model.mtg %} checked="true"{% endif %}/>MTG
						<input type="checkbox" id="iphone_{{model.username}}" name="iphone_{{model.username}}" {% if model.iphone %} checked="true" {% endif %} />iPhone
					{% endif %}
					</div>
				</li>
			</ul>
		</div>
		<input type="submit" name="submit" value="submit"/>
		{% else %}
		<div><label for="username">Add model:</label><input name="username" size="30" value="{% if username %}{{username}}{% endif %}"/></div>
		<input type="submit" name="submit" value="search"/>
		{% endif %}
</form>
</div>
{% endblock %}